<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
	pageEncoding="ISO-8859-1"%>
<%@ taglib uri="http://www.springframework.org/tags/form" prefix="form"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn"%>



<html>
<head>
<title>FINIAC | Finance Manager </title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">



<link href="../css/styles.css" rel="stylesheet" type="text/css">

<style type="text/css">
<!--
body {
	margin-left: 0px;
	margin-top: 5px;
	margin-right: 0px;
	margin-bottom: 0px;
}

-->
.formbutton1 {
	-moz-box-shadow:inset 0px 1px 0px 0px #cae3fc;
	-webkit-box-shadow:inset 0px 1px 0px 0px #cae3fc;
	box-shadow:inset 0px 1px 0px 0px #cae3fc;
	background:-webkit-gradient( linear, left top, left bottom, color-stop(0.05, #79bbff), color-stop(1, #4197ee) );
	background:-moz-linear-gradient( center top, #79bbff 5%, #4197ee 100% );
	filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#79bbff', endColorstr='#4197ee');
	background-color:#79bbff;
	-moz-border-radius:6px;
	-webkit-border-radius:6px;
	border-radius:6px;
	border:1px solid #114d8a;
	display:inline-block;
	color:#ffffff;
	font-family:arial;
	font-size:11px;
	font-weight:bold;
	padding:5px 23px;
	text-decoration:none;
	text-shadow:1px 1px 0px #287ace;
}.formbutton1:hover {
	background:-webkit-gradient( linear, left top, left bottom, color-stop(0.05, #4197ee), color-stop(1, #79bbff) );
	background:-moz-linear-gradient( center top, #4197ee 5%, #79bbff 100% );
	filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#4197ee', endColorstr='#79bbff');
	background-color:#4197ee;
}.formbutton1:active {
	position:relative;
	top:1px;
}
</style>
<script src="../script/jquery-1.7.1.min.js" type="text/javascript"></script>
<script type="text/javascript">

$(document).ready(function() {
	var stock = getUrlVars()["noStock"];
	var noQty = getUrlVars()["noQty"];
	if(stock)
		alert("No enough stock available. \n Only "+stock+" is available");
	if(noQty)
		alert("Quantity required must be greater than zero (0)");
});
function getUrlVars() {
    var vars = {};
    var parts = window.location.href.replace(/[?&]+([^=&]+)=([^&]*)/gi, function(m,key,value) {
        vars[key] = value;
    });
    return vars;
}
</script>

</head>

<body>

<form method="GET" action="viewPrevBill.htm" />
<table width="100%" border="0">
		<tr>
			<td><span class="Bredcrumbs">Point Of Sale&gt;&gt; Previous Bill&gt;&gt;</span></td>
		</tr>
		<tr>
			<td>
			<table width="100%" border="0" cellpadding="0" cellspacing="0">
				<tr>
					<td width="9"><img src="../images/Tright_03_01.gif" width="9"
						height="29"></td>
					<td background="../images/Tcenter.gif" class="body"><strong
						class="boxheader"> Payment Entry  >> <font color="red"> Bill No  : <%=request.getParameter("billNo") %></font></strong></td>

					<td width="10"><img src="../images/Tright_1_01.gif" width="9"
						height="29"></td>
				</tr>
				<tr>
        <td valign="top" background="../images/Tright_03_03.gif"></td>
        <td valign="top" ><table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
          <tr>
            <td ><img src="../images/01.gif" width="5" height="5" /></td>
            <td width="914" background="../images/02.gif"></td>
            <td><img src="../images/03.gif" width="5" height="5" /></td>
          </tr>
          <tr>
            <td width="5"  background="../images/left.gif"></td>
            <td valign="top"><table width="100%" cellspacing="1" cellpadding="2">
                <tr >
          
                  <td class="row-odd" ><div align="right"><span class="Mandatory">*</span> Bill No   :</div></td>
                  <td class="row-even" ><table width="82" border="0" cellspacing="0" cellpadding="0">
                    <tr>
                      <td width="60"><input name="billNo" id="billNo" type="text" size="10" maxlength="10" ></td>
                      
                    </tr>
                  </table></td>
                  </tr>
              
              </table>
             
              </td>
            <td width="5" height="30"  background="../images/right.gif"></td>
          </tr>
          <tr>
            <td height="5"><img src="../images/04.gif" width="5" height="5" /></td>
            <td background="../images/05.gif"></td>
            <td><img src="../images/06.gif" /></td>
          </tr>
        </table></td>
        <td valign="top" background="../images/Tright_3_3.gif" ></td>
     </tr>
      <tr>
        <td height="19" valign="top" background="../images/Tright_03_03.gif"></td>
        <td class="heading"><table width="100%"  border="0" cellspacing="0" cellpadding="0">
          <tr>
            <td width="49%" height="35" align="right"><input name="Submit2" type="submit" class="formbutton1" value="Continue" /></td>
            <td width="2%" height="35" align="center">&nbsp;</td>
            <td width="49%" height="35" align="left"><input name="Submit2" type="reset" class="formbutton1" value="Reset" /></td>
            <td><input name="print" id="print" type="button" class="formbutton1" value="Print" onClick="window.print()" /></td>
          </tr>
        </table></td>
        <td valign="top" background="../images/Tright_3_3.gif" ></td>
      </tr>
				<tr>
					<td height="452" valign="top" background="../images/Tright_03_03.gif"></td>
				  <td valign="top" class="news">
			<c:set var="billNo" value="<%=request.getParameter(\"billNo\")%>" scope="page"/>
			<c:if test="${billNo != null }">
					<table width="100%" cellspacing="1" cellpadding="2">
						<tr bgcolor="#FFFFFF">
							<td height="20" colspan="4">
							<div align="right">
							  
							</div>
							</td>
						</tr>

						<tr>
							<td valign="top" class="news">
							
							</td>
							<td valign="top" background="../images/Tright_3_3.gif" class="news"></td>
						</tr>



					<tr>
						<td valign="top" class="news">
						<table width="100%" border="0" align="center" cellpadding="0"
							cellspacing="0">
							<tr>
								<td><img src="../images/01.gif" width="5" height="5" /></td>
								<td width="914" background="../images/02.gif"></td>
								<td><img src="../images/03.gif" width="5" height="5" /></td>
							</tr>
							<tr>
								<td width="5" background="../images/left.gif"></td>
								<td valign="top">
								<table width="100%" cellspacing="1" cellpadding="2">

						<tr>
							<td height="25" colspan="4">
							<table width="100%" cellspacing="1" cellpadding="2">

								<tr>

									<td width="5%" height="25" class="row-odd" align="center">
									<div align="center">Sl.No </div>
									</td>
									<td height="25" class="row-odd" align="center" style="width: 27%">Item name</td>
									<td class="row-odd" align="center" style="width: 13%">Item code</td>
									<td width="10%" class="row-odd" align="center">
									<div align="center">Quantity </div>
									</td>
									<td width="10%" class="row-odd" align="center">
									<div align="center">Unit Price</div>
									</td>

									<td width="15%" class="row-odd" align="center">
									<div align="center">Amount</div>
									</td>
									
								</tr>	
					
								<c:forEach items="${items}" var="sales" varStatus="status">
								<tr id="record" class="<c:if test="${status.count % 2 == 0}">row-white</c:if><c:if test="${status.count % 2 == 1}">row-even</c:if>">
									
									<td  align="center" height="25">${status.count }</td>
									<td  align="center" style="width: 27%">${sales.productId.product}</td>
								
									<td  align="center" style="width: 10%">${sales.productId.id }</td>
									<td  align="center"  style="width: 10%">${sales.qtySold}</td>
									<td  align="center" style="width: 15%">${sales.productId.sellingPrice}</td>
									<c:set var="Test" value="${sales.total+Test}" scope="page"/>
									

									<td  align="center" style="width: 15%">${sales.total}</td>
										
								</tr>
							</c:forEach>
								
								
								<tr>
										<td class="row-odd" height="30"> </td>
										<td class="row-odd"> </td>
										<td class="row-odd"> </td>
										<td class="row-odd"> </td>
										<td class="row-odd" align="center"> <h2> TOTAL </h2></td>
										<td class="row-odd" align="center"><h2><c:out value="${Test}" />
</h2> </td>
										
										
										
										
								</tr>
							</table>
							</td>
						</tr>

						</table>
							</td>
							<td width="5" height="29" background="../images/right.gif"></td>
						</tr>

						<tr>
							<td height="5"><img src="../images/04.gif" width="5" height="5" /></td>
							<td background="../images/05.gif"></td>
							<td><img src="../images/06.gif" /></td>
						</tr>
					</table>
					</td>
					<td valign="top" background="../images/Tright_3_3.gif" class="news"></td>
				</tr>


					</table>
					
	</c:if>
					</td>
					<td width="10" valign="top" background="../images/Tright_3_3.gif"
						class="news"></td>
				</tr>

				<tr>
					<td valign="top" background="../images/Tright_03_03.gif"></td>
					<td height="20" valign="top"></td>
					<td width="13" valign="top" background="../images/Tright_3_3.gif"
						class="news"></td>
				</tr>
				<tr>
					<td><img src="../images/Tright_03_05.gif" width="9" height="29" /></td>
					<td width="100%" background="../images/TcenterD.gif"></td>
					<td><img src="../images/Tright_02.gif" width="9" height="29" /></td>
				</tr>
			</table>
			</td>
		</tr>
	</table>
	</form>
</body>
</html>